﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;
using LngT.Interfaces;

namespace LngTGUI
    {
    public partial class Form1: Form
        {
        public Form1()
            {
            InitializeComponent();
            }

        private void button1_Click( object sender, EventArgs e )
            {
            ChannelServices.RegisterChannel( new TcpChannel(), false );

            ISessionManager m = ( ISessionManager )Activator.GetObject(
                typeof( IManager ), "tcp://localhost:50050/Manager" );
            IController con = m.AddDatabase( "dupa", "tomek", "tomek" );
            if( con.Authenticate( "tomek", "tomek" ) )
                con.AddItem( new PL_DE_Item( "plaża", "strand" ));
            }

        private void button5_Click( object sender, EventArgs e )
            {

            }
        }
    }